/*
 * An XML document type.
 * Localname: ConfigurationProperties
 * Namespace: http://www.hpsearch.org/schemas/2006/05/BSA
 * Java type: cgl.narada.mgmt.schemas.bsa.ConfigurationPropertiesDocument
 *
 * Automatically generated - do not modify.
 */
package cgl.narada.mgmt.schemas.bsa.impl;
/**
 * A document containing one ConfigurationProperties(@http://www.hpsearch.org/schemas/2006/05/BSA) element.
 *
 * This is a complex type.
 */
public class ConfigurationPropertiesDocumentImpl extends org.apache.xmlbeans.impl.values.XmlComplexContentImpl implements cgl.narada.mgmt.schemas.bsa.ConfigurationPropertiesDocument
{
    
    public ConfigurationPropertiesDocumentImpl(org.apache.xmlbeans.SchemaType sType)
    {
        super(sType);
    }
    
    private static final javax.xml.namespace.QName CONFIGURATIONPROPERTIES$0 = 
        new javax.xml.namespace.QName("http://www.hpsearch.org/schemas/2006/05/BSA", "ConfigurationProperties");
    
    
    /**
     * Gets the "ConfigurationProperties" element
     */
    public cgl.narada.mgmt.schemas.bsa.ConfigurationPropertiesDocument.ConfigurationProperties getConfigurationProperties()
    {
        synchronized (monitor())
        {
            check_orphaned();
            cgl.narada.mgmt.schemas.bsa.ConfigurationPropertiesDocument.ConfigurationProperties target = null;
            target = (cgl.narada.mgmt.schemas.bsa.ConfigurationPropertiesDocument.ConfigurationProperties)get_store().find_element_user(CONFIGURATIONPROPERTIES$0, 0);
            if (target == null)
            {
                return null;
            }
            return target;
        }
    }
    
    /**
     * Sets the "ConfigurationProperties" element
     */
    public void setConfigurationProperties(cgl.narada.mgmt.schemas.bsa.ConfigurationPropertiesDocument.ConfigurationProperties configurationProperties)
    {
        synchronized (monitor())
        {
            check_orphaned();
            cgl.narada.mgmt.schemas.bsa.ConfigurationPropertiesDocument.ConfigurationProperties target = null;
            target = (cgl.narada.mgmt.schemas.bsa.ConfigurationPropertiesDocument.ConfigurationProperties)get_store().find_element_user(CONFIGURATIONPROPERTIES$0, 0);
            if (target == null)
            {
                target = (cgl.narada.mgmt.schemas.bsa.ConfigurationPropertiesDocument.ConfigurationProperties)get_store().add_element_user(CONFIGURATIONPROPERTIES$0);
            }
            target.set(configurationProperties);
        }
    }
    
    /**
     * Appends and returns a new empty "ConfigurationProperties" element
     */
    public cgl.narada.mgmt.schemas.bsa.ConfigurationPropertiesDocument.ConfigurationProperties addNewConfigurationProperties()
    {
        synchronized (monitor())
        {
            check_orphaned();
            cgl.narada.mgmt.schemas.bsa.ConfigurationPropertiesDocument.ConfigurationProperties target = null;
            target = (cgl.narada.mgmt.schemas.bsa.ConfigurationPropertiesDocument.ConfigurationProperties)get_store().add_element_user(CONFIGURATIONPROPERTIES$0);
            return target;
        }
    }
    /**
     * An XML ConfigurationProperties(@http://www.hpsearch.org/schemas/2006/05/BSA).
     *
     * This is a complex type.
     */
    public static class ConfigurationPropertiesImpl extends org.apache.xmlbeans.impl.values.XmlComplexContentImpl implements cgl.narada.mgmt.schemas.bsa.ConfigurationPropertiesDocument.ConfigurationProperties
    {
        
        public ConfigurationPropertiesImpl(org.apache.xmlbeans.SchemaType sType)
        {
            super(sType);
        }
        
        private static final javax.xml.namespace.QName PROPERTY$0 = 
            new javax.xml.namespace.QName("", "Property");
        
        
        /**
         * Gets array of all "Property" elements
         */
        public cgl.narada.mgmt.schemas.bsa.PropertyType[] getPropertyArray()
        {
            synchronized (monitor())
            {
                check_orphaned();
                java.util.List targetList = new java.util.ArrayList();
                get_store().find_all_element_users(PROPERTY$0, targetList);
                cgl.narada.mgmt.schemas.bsa.PropertyType[] result = new cgl.narada.mgmt.schemas.bsa.PropertyType[targetList.size()];
                targetList.toArray(result);
                return result;
            }
        }
        
        /**
         * Gets ith "Property" element
         */
        public cgl.narada.mgmt.schemas.bsa.PropertyType getPropertyArray(int i)
        {
            synchronized (monitor())
            {
                check_orphaned();
                cgl.narada.mgmt.schemas.bsa.PropertyType target = null;
                target = (cgl.narada.mgmt.schemas.bsa.PropertyType)get_store().find_element_user(PROPERTY$0, i);
                if (target == null)
                {
                    throw new IndexOutOfBoundsException();
                }
                return target;
            }
        }
        
        /**
         * Returns number of "Property" element
         */
        public int sizeOfPropertyArray()
        {
            synchronized (monitor())
            {
                check_orphaned();
                return get_store().count_elements(PROPERTY$0);
            }
        }
        
        /**
         * Sets array of all "Property" element
         */
        public void setPropertyArray(cgl.narada.mgmt.schemas.bsa.PropertyType[] propertyArray)
        {
            synchronized (monitor())
            {
                check_orphaned();
                arraySetterHelper(propertyArray, PROPERTY$0);
            }
        }
        
        /**
         * Sets ith "Property" element
         */
        public void setPropertyArray(int i, cgl.narada.mgmt.schemas.bsa.PropertyType property)
        {
            synchronized (monitor())
            {
                check_orphaned();
                cgl.narada.mgmt.schemas.bsa.PropertyType target = null;
                target = (cgl.narada.mgmt.schemas.bsa.PropertyType)get_store().find_element_user(PROPERTY$0, i);
                if (target == null)
                {
                    throw new IndexOutOfBoundsException();
                }
                target.set(property);
            }
        }
        
        /**
         * Inserts and returns a new empty value (as xml) as the ith "Property" element
         */
        public cgl.narada.mgmt.schemas.bsa.PropertyType insertNewProperty(int i)
        {
            synchronized (monitor())
            {
                check_orphaned();
                cgl.narada.mgmt.schemas.bsa.PropertyType target = null;
                target = (cgl.narada.mgmt.schemas.bsa.PropertyType)get_store().insert_element_user(PROPERTY$0, i);
                return target;
            }
        }
        
        /**
         * Appends and returns a new empty value (as xml) as the last "Property" element
         */
        public cgl.narada.mgmt.schemas.bsa.PropertyType addNewProperty()
        {
            synchronized (monitor())
            {
                check_orphaned();
                cgl.narada.mgmt.schemas.bsa.PropertyType target = null;
                target = (cgl.narada.mgmt.schemas.bsa.PropertyType)get_store().add_element_user(PROPERTY$0);
                return target;
            }
        }
        
        /**
         * Removes the ith "Property" element
         */
        public void removeProperty(int i)
        {
            synchronized (monitor())
            {
                check_orphaned();
                get_store().remove_element(PROPERTY$0, i);
            }
        }
    }
}
